package com.njd.meitu.tv.main;

import com.njd.meitu.tv.R;

import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class MenuAdapter extends BaseAdapter {
	@Override
	public int getCount() {
		return 3;
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@SuppressLint({ "InflateParams", "ViewHolder" })
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		convertView = LayoutInflater.from(parent.getContext()).inflate(
				R.layout.list_cell_popup_menu, null);
		TextView name = (TextView) convertView
				.findViewById(R.id.tv_name);
		int iconResId = 0;

		if (position == 0) {
			name.setText("关于");
			iconResId = R.drawable.actionbar_menu_icn_software;
		} else if (position == 1) {
			name.setText("设置");
			iconResId = R.drawable.actionbar_menu_icn_set;
		} else if (position == 2) {
			name.setText("退出应用");
			iconResId = R.drawable.actionbar_menu_icn_exit; 
		}
//		Drawable drawable = AppContext.resources().getDrawable(
//				iconResId);
//		drawable.setBounds(0, 0, drawable.getMinimumWidth(),
//				drawable.getMinimumHeight());
//		name.setCompoundDrawables(drawable, null, null, null);
		return convertView;
	}

}
